package com.gjy.spring.s8.scope;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-12-20 11:27:48
 */
@ComponentScan({"com.gjy.spring.s8.scope"})
public class S8ScopeApp {
    private static final Logger log = LoggerFactory.getLogger(S8ScopeApp.class);

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(S8ScopeApp.class);
        E e = context.getBean(E.class);

        log.info("f: {}", e.getF().getClass());
        log.info("f: {}", e.getF());
        log.info("f: {}", e.getF());
        log.info("f2: {}", e.getF2().getClass());
        log.info("f2: {}", e.getF2());
        log.info("f2: {}", e.getF2());
        log.info("f3: {}", e.getF3().getClass());
        log.info("f3: {}", e.getF3());
        log.info("f3: {}", e.getF3());
        log.info("f4: {}", e.getF4().getClass());
        log.info("f4: {}", e.getF4());
        log.info("f4: {}", e.getF4());
        context.close();
    }
}
